/**
 * 用户预约核心操作接口API
 */
import request from '@/utils/request'
// import qs from 'qs'

// 获取用户预约列表
const getBookingList = (query) => {
  return request({
    url: '/addons/venues/api/joinlist',
    method: 'get',
    params: query
  })
}

// 取消单个预约
const cancelSingleBooking = (query) => {
  return request({
    url: '/addons/venues/api/cancel',
    method: 'get',
    params: query
  })
}

// 获取单个预约详情
const getBookingDetails = (query) => {
  return request({
    url: '/addons/venues/api/joindetail',
    method: 'get',
    params: query
  })
}

// 预约评论功能
const submitBookingRate = (data) => {
  return request({
    url: '/addons/venues/api/comment',
    method: 'post',
    data
  })
}

// 确认到达功能
const confirmArrive = (query) => {
  return request({
    url: '/addons/venues/api/join',
    method: 'get',
    params: query
  })
}
// 确认到达功能(非本人)
const confirmArriveNot = (query) => {
  return request({
    url: '/addons/venues/apicode/join',
    method: 'get',
    params: query
  })
}

export default {
  getBookingList,
  cancelSingleBooking,
  getBookingDetails,
  submitBookingRate,
  confirmArrive,
  confirmArriveNot
}
